$(document).ready(function(){
    $('#demo-nav a').hover(function(){
        $('#demo-nav a').removeClass('active');
        $(this).addClass('active');
        $('.tab').hide();
        var tab_id = $(this).attr('href');
        $(tab_id).show();
        if(tab_id == '#tab2' && $(tab_id).html() == ''){
            $(tab_id).html('<center><img src="./images/web/default/loading.gif" alt="" title="" border="0" /><br />载入中...</center>');
            $.post('index.php', {
                m:'design',
                p:'detail',
                action:'get_data',
                design_id:$('#design_id').val(),
                provider_id:$('#provider_id').val()
                }, function(data){
                var html = ''
                if(data.length > 0){
                    for(var i = 0; i < data.length; i++){
                        html += '<div class="new_prod_box"><a href="index.php?m=design&p=detail&design_id='+data[i].design_id+'">'+data[i].design_name+'</a><div class="new_prod_bg"><a href="index.php?m=design&p=detail&design_id='+data[i].design_id+'""><img src="./attachment/design/'+data[i].design_year+'/'+data[i].design_month+'/'+data[i].provider_id+'/'+data[i].design_id+'/'+data[i].thumb_img+'" alt="" title="" class="thumb" border="0" /></a></div></div><div class="clear"></div>';
                    }
                }else{
                    html = '<center><br />暂无相关产品</center>';
                }
                $(tab_id).html(html);
            }, 'json');
        }
    },null);
    
    //$.alerts.okButton = '关闭';
    $('#button_zoom').click(function(){

        jShowimage($(this).attr('original_img'),$(this).attr('original_title'));
    });
});